﻿<%@ Control Language="C#" AutoEventWireup="true" Codebehind="ModuleDefinitionEdit.ascx.cs"
    Inherits="Portal.Administrator.Modules.ModuleDefinitionEdit" %>
<%@ Register Assembly="NCS.WebControl" Namespace="NCS.WebControls" TagPrefix="cc2" %>
<%@ Register Assembly="System.Web.Extensions" Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Assembly="NCS.Library" Namespace="NCS.Library.Controls"
    TagPrefix="cc3" %>
<asp:UpdatePanel ID="upanelModuleDefinitionEdit" runat="server" UpdateMode="Conditional"
    RenderMode="Inline">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="btnUpdate" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="btnDelete" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="btnCancel" EventName="Click" />
    </Triggers>
    <ContentTemplate>
        <table border="0" cellpadding="0" cellspacing="0" class="InputBox" style="width: 100%">
            <tr>
                <td>
                    <asp:Label ID="lblModuleID" runat="server" Text="Module ID" meta:resourcekey="lblModuleIDResource1"></asp:Label></td>
                <td>
                    <asp:TextBox ID="txtID" runat="server" Enabled="False" Width="79px" meta:resourcekey="txtIDResource1"></asp:TextBox></td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblModuleName" runat="server" Text="Tên module" meta:resourcekey="lblModuleNameResource1"></asp:Label></td>
                <td>
                    <asp:TextBox ID="txtModuleName" runat="server" Width="285px" meta:resourcekey="txtModuleNameResource1"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtModuleName"
                        ErrorMessage="Chưa nhập tên module" meta:resourcekey="RequiredFieldValidator1Resource1"></asp:RequiredFieldValidator></td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblTitle" runat="server" Text="Title" meta:resourcekey="lblTitleResource1"></asp:Label></td>
                <td>
                    <asp:TextBox ID="txtModuleTitle" runat="server" Width="338px" meta:resourcekey="txtModuleTitleResource1"></asp:TextBox></td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblDesc" runat="server" Text="Mô tả" meta:resourcekey="lblDescResource1"></asp:Label></td>
                <td>
                    <asp:TextBox ID="txtModuleDescription" runat="server" Height="62px" TextMode="MultiLine"
                        Width="285px" meta:resourcekey="txtModuleDescriptionResource1"></asp:TextBox></td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblDirectory" runat="server" Text="Thư mục" meta:resourcekey="lblDirectoryResource1"></asp:Label></td>
                <td>
                    <asp:TextBox ID="txtModuleFolder" runat="server" Width="338px" meta:resourcekey="txtModuleFolderResource1"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtModuleFolder"
                        ErrorMessage="Chưa nhập đường dẫn" meta:resourcekey="RequiredFieldValidator2Resource1"></asp:RequiredFieldValidator></td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td colspan="2" style="height: 24px">
                    &nbsp;<cc2:ButtonRoleEdit ID="btnUpdate" runat="server" CssClass="Button" Text="Cập nhật"
                        OnClick="btnUpdate_Click" Width="77px" />
                    <cc2:ButtonRoleDelete ID="btnDelete" runat="server" CssClass="Button" Text="Xóa"
                        OnClick="btnDelete_Click" Width="77px" />
                    <asp:Button ID="btnCancel" runat="server" CssClass="Button" OnClick="btnCancel_Click"
                        Text="Hủy" Width="77px" meta:resourcekey="btnCancelResource1" />
                    <asp:Label ID="lblUpdateStatus" runat="server" Font-Bold="True" ForeColor="Blue"
                        meta:resourcekey="lblUpdateStatusResource1"></asp:Label></td>
            </tr>
        </table>
    </ContentTemplate>
</asp:UpdatePanel>
<table width="100%">
   
    <tr>
        <td colspan="2">
            <asp:UpdatePanel ID="upanelModuleDefinitionEdit1" runat="server" UpdateMode="Conditional"
                RenderMode="Inline">
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="dtgModuleControls" EventName="RowCommand" />                   
                </Triggers>
                <ContentTemplate>
                    <cc3:GridView ID="dtgModuleControls" runat="server" AutoGenerateColumns="False" BorderColor="Gainsboro"
                        BorderStyle="Solid" BorderWidth="1px" CaptionAlign="Top" CellPadding="2" CssClass="Grid" 
                        OnRowCommand="dtgModuleControls_RowCommand" OnRowDataBound="dtgModuleControls_RowDataBound"
                        Width="100%" meta:resourcekey="dtgModuleControlsResource1" AllowPaging="True" PageSize="16">
                        <AlternatingRowStyle CssClass="Grid_Raw2" />
                        <RowStyle CssClass="Grid_Raw1" />
                        <HeaderStyle CssClass="Grid_Top" Font-Bold="True" />
                        <Columns>
                            <asp:BoundField DataField="ControlID" Visible="False" meta:resourcekey="BoundFieldResource1" />
                            <asp:BoundField DataField="ControlName" HeaderText="T&#234;n control" meta:resourcekey="BoundFieldResource2" />
                            <asp:BoundField DataField="ControlKey" HeaderText="Lệnh" meta:resourcekey="BoundFieldResource3" />
                            <asp:BoundField DataField="ControlPath" HeaderText="Đường dẫn" meta:resourcekey="BoundFieldResource4" />
                            <asp:TemplateField HeaderText="Thao t&#225;c"  meta:resourcekey="TemplateFieldResource1">
                                <ItemStyle HorizontalAlign="Center" width="150px" />
                                <ItemTemplate>
                                    <cc2:ButtonRoleEdit ID="btnEditControl" runat="server" CommandArgument='<%# Eval("ControlID") %>'
                                        CommandName="editcontrol" CssClass="Button70" Text="Sửa"  meta:resourcekey="btnEditControlResource1" />
                                    <cc2:ButtonRoleDelete ID="btnDeleteControl" runat="server" CommandArgument='<%# Eval("ControlID") %>'
                                        CommandName="deletecontrol" CssClass="Button70" Text="X&#243;a"  meta:resourcekey="btnDeleteControlResource1" />
                                
</ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </cc3:GridView>
                </ContentTemplate>
            </asp:UpdatePanel>
        </td>
    </tr>
    <tr>
        <td colspan="2">
        </td>
    </tr>
    <tr>
        <td colspan="2">
            &nbsp;<cc2:ButtonRoleAdd ID="btnAddControl" runat="server" CssClass="Button" Text="Thêm mới"
                OnClick="btnAddControl_Click" /></td>
    </tr>
</table>
